import { createRouter, createWebHashHistory } from 'vue-router';

import Layout from '../views/layout/Index.vue';
import Login from '../views/login/Index.vue';
import Home from '../views/layout/content/home/Index.vue'
// import User from '../views/layout/content/user/User.vue'
const User = () => import('../views/layout/content/user/User.vue')
const UserManagement = () => import('../views/layout/content/user/UserManagement.vue')
// import UserManagement from '../views/layout/content/user/UserManagement.vue'
// import Authority from '../views/layout/content/user/authority.vue'
const Authority = () => import('../views/layout/content/user/authority.vue')
const UserAccount = () => import('../views/layout/content/user/UserAccount.vue')
import Article from '../views/layout/content/article/Article.vue'
import Column from '../views/layout/content/column/Column.vue'
import ReportForms from '../views/layout/content/reportforms/ReportForms.vue'
import System from '../views/layout/content/system/System.vue'
const routes = [
    {
        // 首页
        path: '/',
        component: Layout,
        children: [
            {
                path: '/',
                name: 'home',
                component: Home
            },
            {
                path: '/User',
                name: 'User',
                component: User,
                children: [
                    {
                        // 角色管理
                        path: 'UserManagement',
                        name: 'UserManagement',
                        component: UserManagement
                    }, {
                        // 权限管理
                        path: 'Authority',
                        name: 'Authority',
                        component: Authority
                    }, {
                        // 用户账号
                        path: 'UserAccount',
                        name: 'UserAccount',
                        component: UserAccount
                    }
                ],
            },
            {
                path: 'Article',
                name: 'Article',
                component: Article
            },
            {
                path: 'Column',
                name: 'Column',
                component: Column
            },
            {
                path: 'ReportForms',
                name: 'ReportForms',
                component: ReportForms
            },
            {
                path: 'System',
                name: 'System',
                component: System
            }


        ]
    }, {
        // 登陆
        path: '/login',
        name: 'login',
        component: Login
    }

]
// 3. 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHashHistory(),

    routes, // `routes: routes` 的缩写
})

export default router;